#include "../Common/Thread.h"
#include "Data.h"

class ChangerThread : public CThread
{
public:
    ChangerThread(std::string name, Data* data)
        : CThread(name), data(data)
    {
    }
    ~ChangerThread()
    {
    }

public:
    void run()
    {
        srand(349823);
        char buf[256];
        for(int i = 0; ; i++)
        {
            sprintf(buf, "No.%d", i);
            data->change(buf);
            Sleep(rand()%1000);
            data->save();
        }
    }

private:
    Data* data;
};